package com.zj.osm.entity.greendao;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Index;
import org.greenrobot.greendao.annotation.Generated;

/**
 * <pre>
 *     author : luhenchang
 *     e-mail : 1276998208@qq.com
 *     time   : 2020/04/26
 *     desc   : 版权所有
 *     version: 1.0
 * </pre>
 */
@Entity
public class Lay implements Parcelable {
    @Id(autoincrement = true)
    private Long id;
    //线的ID
    @Index(unique = true)
    private Long lineId;
    //敷设方式ID
    private String layId;
    //敷设方式名称
    private String layName;
    //敷设方式位置
    private String layXY;
    //敷设方式每一个位置的状态
    private String layState;
    @Generated(hash = 1373257447)
    public Lay(Long id, Long lineId, String layId, String layName, String layXY,
            String layState) {
        this.id = id;
        this.lineId = lineId;
        this.layId = layId;
        this.layName = layName;
        this.layXY = layXY;
        this.layState = layState;
    }
    @Generated(hash = 2004310540)
    public Lay() {
    }
    public Long getId() {
        return this.id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public Long getLineId() {
        return this.lineId;
    }
    public void setLineId(Long lineId) {
        this.lineId = lineId;
    }
    public String getLayId() {
        return this.layId;
    }
    public void setLayId(String layId) {
        this.layId = layId;
    }
    public String getLayName() {
        return this.layName;
    }
    public void setLayName(String layName) {
        this.layName = layName;
    }
    public String getLayXY() {
        return this.layXY;
    }
    public void setLayXY(String layXY) {
        this.layXY = layXY;
    }
    public String getLayState() {
        return this.layState;
    }
    public void setLayState(String layState) {
        this.layState = layState;
    }

    @Override
    public String toString() {
        return "Lay{" +
                "id=" + id +
                ", lineId=" + lineId +
                ", layId='" + layId + '\'' +
                ", layName='" + layName + '\'' +
                ", layXY='" + layXY + '\'' +
                ", layState='" + layState + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeValue(this.id);
        dest.writeValue(this.lineId);
        dest.writeString(this.layId);
        dest.writeString(this.layName);
        dest.writeString(this.layXY);
        dest.writeString(this.layState);
    }

    protected Lay(Parcel in) {
        this.id = (Long) in.readValue(Long.class.getClassLoader());
        this.lineId = (Long) in.readValue(Long.class.getClassLoader());
        this.layId = in.readString();
        this.layName = in.readString();
        this.layXY = in.readString();
        this.layState = in.readString();
    }

    public static final Parcelable.Creator<Lay> CREATOR = new Parcelable.Creator<Lay>() {
        @Override
        public Lay createFromParcel(Parcel source) {
            return new Lay(source);
        }

        @Override
        public Lay[] newArray(int size) {
            return new Lay[size];
        }
    };
}
